package com.liu.vo;

import lombok.Data;

@Data
public class JsonResult {

    private Integer code;
    private String msg;
    private Long count;
    private Object data;


    public static JsonResult getJsonResult(){
        JsonResult jsonResult=new JsonResult();
        jsonResult.setCode(0);
        jsonResult.setMsg("异常信息");

        return jsonResult;

    }


    //成功返回
    public static JsonResult ok(){
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode(0);
        jsonResult.setMsg("success");

        return jsonResult;
    }

    //失败返回
    public static JsonResult fail(){
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode(-1);
        jsonResult.setMsg("error");

        return jsonResult;
    }
}
